let person = {
  name: 'fanchao',
  age: 24
}
Object.keys(person).forEach(key => {
  let val = person[key]
  Object.defineProperty(person, key, {
    enumerable: true,
    configurable: false,
    get: () => {
      console.log(`${key} has been get`)
      return val
    },
    set: (newVal) => {
      if (val === newVal) return
      console.log(`${key} has been setter`)
      val = newVal
    }
  })
})
console.log(person.name)
console.log(person.age)
person.name = 'fanchao1'
person.age = 25
console.log(person.name)
console.log(person.age)
console.log(person.name)
console.log(person.age)
